//
//  PSWageRangeModel.m
//  Btpin
//
//  Created by Vic on 2019/6/16.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "PSWageRangeModel.h"

@implementation PSWageRangeModel

- (void)setValuesForKeysWithDictionary:(NSDictionary<NSString *,id> *)keyedValues {
    self.id = [UIToolsControl dataAnalysis:keyedValues[@"id"]];
    self.showText = [UIToolsControl dataAnalysis:keyedValues[@"showText"]];
    self.dataText = [UIToolsControl dataAnalysis:keyedValues[@"dataText"]];
    
    self.itemWageRangeArray = [NSMutableArray arrayWithCapacity:0];
    if ([keyedValues[@"items"] isKindOfClass:[NSArray class]]) {
        for (NSInteger i = 0; i<[keyedValues[@"items"] count]; i++) {
            NSDictionary *dic = keyedValues[@"items"][i];
            PSWageRangeModel *model = [[PSWageRangeModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [self.itemWageRangeArray addObject:model];
        }
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

- (id)copyWithZone:(NSZone *)zone {
    PSWageRangeModel *model = [[[self class] allocWithZone:zone] init];
    model.id = self.id;
    model.showText = self.showText;
    model.dataText = self.dataText;
    
    model.itemWageRangeArray = [NSMutableArray arrayWithCapacity:0];
    if (self.itemWageRangeArray.count) {
        for (PSWageRangeModel *tempModel in self.itemWageRangeArray) {
            [model.itemWageRangeArray addObject:[tempModel copy]];
        }
    }
    
    return model;
}

@end
